% \iffalse meta-comment
%
% Copyright 1994 the LaTeX3 project and the individual authors.
% All rights reserved. For further copyright information see the file
% legal.txt, and any other copyright indicated in this file.
% 
% This file is part of the LaTeX2e system.
% ----------------------------------------
% 
%  This system is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% 
% 
% IMPORTANT NOTICE:
% 
% For error reports in case of UNCHANGED versions see bugs.txt.
% 
% Please do not request updates from us directly.  Distribution is
% done through Mail-Servers and TeX organizations.
% 
% You are not allowed to change this file.
% 
% You are allowed to distribute this file under the condition that
% it is distributed together with all files mentioned in manifest.txt.
% 
% If you receive only some of these files from someone, complain!
% 
% You are NOT ALLOWED to distribute this file alone.  You are NOT
% ALLOWED to take money for the distribution or use of either this
% file or a changed version, except for a nominal charge for copying
% etc.
% \fi

%%%%
%%%% Patch file for the LaTeX2e kernel dated 1994/12/01
%%%% (1995/03/30)

\def\fmtversion@topatch{1994/12/01} % This patch will not work with
                                    % any other release.

\def\patch@level{3}


%%%
%%% patch 1
%%%


%%%
%%% latex/1275  \it \bf fix for first use in math mode.q
%%%

\def\select@group#1#2#3#4{%
 \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 {%
 \ifmmode
  \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n
     \begingroup
       \escapechar\m@ne
       \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
       \globaldefs\@ne  \math@fonts
     \endgroup
     \ifrestore@version
        \global\restore@versionfalse
        \xdef\restore@mathversion
             {\expandafter\noexpand\csname mv@\math@version\endcsname
              \global\csname c@mv@\math@version\endcsname
              \number\csname c@mv@\math@version\endcsname\relax}%
        \aftergroup\dorestore@version
     \fi
     \xdef#1{\noexpand\use@mathgroup\noexpand#2%
             {\number\csname c@mv@\math@version\endcsname}}%
     \stepcounter{mv@\math@version}%
   \else
     \let#1\relax
     \@latex@error{Too many math alphabets used in
                   version \math@version}%
        \@eha
   \fi
 \else \expandafter\non@alpherr\fi
 #1{#4}%
 }%
}

\def\document@select@group#1#2#3#4{%
 \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 {%
 \ifmmode
   \ifnum\csname c@mv@\math@version\endcsname<\sixt@@n
     \begingroup
       \escapechar\m@ne
       \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
       \globaldefs\@ne  \math@fonts
     \endgroup
     \expandafter\extract@alph@from@version
         \csname mv@\math@version\expandafter\endcsname
         \expandafter{\number\csname
                       c@mv@\math@version\endcsname}%
          #1%
     \stepcounter{mv@\math@version}%
   \else
     \let#1\relax
     \@latex@error{Too many math alphabets used
                   in version \math@version}%
        \@eha
  \fi
 \else \expandafter\non@alpherr\fi
 #1{#4}%
 }%
}

\def \@fontswitch #1#2{%
  \ifmmode
     \let \math@bgroup \relax
     \def \math@egroup {%
                        \let \math@bgroup \@@math@bgroup
                        \let \math@egroup \@@math@egroup
                        }%
     #2\relax
%%     ^^^^^^
  \else
     #1%
  \fi
}



%%%
%%% latex/1274: \k{} doesn't produce an ogonek accent
%%%
%%% In fact this patch (Which works if T1 encoding is selected
%%% via the old t1enc.sty) is not sufficient for the latest version
%%% of fontenc.sty, which forces t1enc.def to be reloaded.
%%% \k will be fixed in t1enc.def at the next full release.
\DeclareTextCommand{\k}{T1}[1]
   {\oalign{\null#1\crcr\hidewidth\char12}}
\DeclareTextComposite{\k}{T1}{A}{129}



%%%
%%% Tracing code accidently left in production format.
%%%
\let\@tracemessage\@undefined
\let\tracefloats\@undefined
\let\notrace\@undefined
\let\tr@ce\@undefined
\let\@traceval\@undefined
\let\tracefloatvals\@undefined


%%%%%%%%%%%%%%%

%%%
%%% patch 2
%%%

%%%
%%% latex/1239:  Bug report on ltbibl (base
%%%
%%% Undefined references generate an error if superscript style
%%% citations defined via $^...
%%% This may not be the final solution to this.
\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@iden\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
                              %%%%%
       \G@refundefinedtrue\@latex@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}


%%%
%%% 1240 (internal) Saving more memory
%%%
\@onlypreamble\DeclareTextSymbolDefault
\@onlypreamble\DeclareTextAccentDefault
\@onlypreamble\DeclareTextCommandDefault
\@onlypreamble\DeclareTextAccent


%%%
%%% tools/1296: fontsmpl.tex gives TeX capacity exceeded
%%%
\let\textless\undefined
\let\textgreater\undefined


%%%
%%% 1317 (internal) \@for expanding its argument incorectly
%%%
\def\@for#1:=#2\do#3{%
%  \def\@fortmp{#2}%
  \expandafter\def\expandafter\@fortmp\expandafter{#2}%
   %%%
  \ifx\@fortmp\@empty
  \else
    \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}%
  \fi}

%%%
%%% latex/1322: Again a problem with \^\i in headings ...
%%%
%%% THIS IS A TEMPORARY FIX FOR THIS PATCH ONLY.
%%% A FULL SOLUTION IS BEING INVESTIGATED, AND WILL BE INSTALLED
%%% IN THE JUNE RELEASE OF LATEX.
%%%
\def\markboth#1#2{\gdef\@themark{{#1}{#2}}{%
     \let\protect\@unexpandable@protect
     \let\label\relax \let\index\relax \let\glossary\relax
\let\i\relax\let\j\relax
%%%%%%%%%%%%%%%%%%%%%%%%
     \mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}
\def\markright#1{{\let\protect\@unexpandable@protect
     \let\label\relax \let\index\relax \let\glossary\relax
\let\i\relax\let\j\relax
%%%%%%%%%%%%%%%%%%%%%%%%
     \expandafter\@markright\@themark
     {#1}\mark{\@themark}}\if@nobreak\ifvmode\nobreak\fi\fi}


%%%
%%% latex/1329 + 1332: 
%%%         the primitive \abovewithdelims does not work in LaTeX
\def\set@mathdelimiter#1#2#3#4#5#6{%
\xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5%
                                       \hexnumber@#2#6 }}
                                                      % space not \relax
\InputIfFileExists{fontmath.cfg}%
    {\typeout{%
      Warning: Due to a bug in \protect\DeclareMathDelimiter,^^J%
      fontmath.cfg is being input for a second time.}}%
    {\input{fontmath.ltx}}



%%%
%%% latex/1344 + 1463  emergencystretch
%%%
\def\fussy{\tolerance 200
           \emergencystretch\z@
           %%%%%%%%%%%%%%%%%%%%
            \hfuzz .1\p@ \vfuzz .1\p@}



%%%
%%% latex/1346: \@check@c needs to be \long
%%%
\long\def\@check@c#1#2#3{%
%%%%%
  \expandafter\let\csname\string\reserved@a\endcsname\relax
  \renew@command\reserved@a#2{#3}%
  \@ifundefined{\string\reserved@a}%
   {\@check@eq#1\reserved@a}%
   {\expandafter\@check@eq
           \csname\string#1\expandafter\endcsname
           \csname\string\reserved@a\endcsname}}


%%%
%%% 1388 (internal) Saving space
%%%
\@onlypreamble\newlabel
\@onlypreamble\bibcite


%%%
%%% latex/1392: AtBeginDvi broken
%%%
\def\AtBeginDvi#1{%
  \global\setbox\@begindvibox
    \vbox{\unvbox \@begindvibox #1}}
    %%%%%


%%%
%%% 1405 (internal) Make allocations non-outer
%%%
\def\newmuskip{\alloc@3\muskip\muskipdef\@cclvi}
\def\newtoks{\alloc@5\toks\toksdef\@cclvi}
\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
\def\newread{\alloc@6\read\chardef\sixt@@n}
\def\newlanguage{\alloc@9\language\chardef\@cclvi}
\def\newinsert#1{\global\advance\insc@unt by\m@ne
  \ch@ck0\insc@unt\count
  \ch@ck1\insc@unt\dimen
  \ch@ck2\insc@unt\skip
  \ch@ck4\insc@unt\box
  \allocationnumber=\insc@unt
  \global\chardef#1=\allocationnumber
  \wlog{\string#1=\string\insert\the\allocationnumber}}
\def\newif#1{\count@\escapechar \escapechar\m@ne
  \expandafter\expandafter\expandafter
   \edef\@if#1{true}{\let\noexpand#1=\noexpand\iftrue}%
  \expandafter\expandafter\expandafter
   \edef\@if#1{false}{\let\noexpand#1=\noexpand\iffalse}%
  \@if#1{false}\escapechar\count@} % the condition starts out false


%%%
%%% latex/1407 + 1420  Missing character if ams packages are used
%%%
\def\document{\endgroup
  \ifx\@unusedoptionlist\@empty\else
    \@latex@warning@no@line{Unused global option(s):^^J%
            \@spaces[\@unusedoptionlist]}%
  \fi
  \@colht\textheight
  \@colroom\textheight \vsize\textheight
  \columnwidth\textwidth
  \@clubpenalty\clubpenalty
  \if@twocolumn
    \advance\columnwidth -\columnsep
    \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
  \fi
  \hsize\columnwidth \linewidth\hsize
  \begingroup\@floatplacement\@dblfloatplacement
   \makeatletter\let\@writefile\@gobbletwo
   \global\@multiplelabelsfalse
   \@input{\jobname.aux}%
  \endgroup
  \if@filesw
    \immediate\openout\@mainaux\jobname.aux
    \immediate\write\@mainaux{\relax}%
  \fi
  \process@table
  \let\glb@currsize\@empty  %% Force math initialisation.
  \normalsize% \the\every@math@size
%%           ^^^^^^^^^^^^^^^^^^^^^^ removed above
  \everypar{}\@noskipsecfalse\G@refundefinedfalse
  \@begindocumenthook
  \let\@begindocumenthook\@undefined
  \ifx\@listfiles\@undefined
    \let\@filelist\relax
    \let\@addtofilelist\@gobble
  \fi
  \def\do##1{\let ##1\@notprerr}%
  \@preamblecmds
  \let\do\noexpand
}


%%%
%%% 1440 (internal) Please use the math alphabet \@mathbfinstead
%%%                                 ^^^^^^^^^
\def\not@math@alphabet#1#2{%
   \relax
   \ifmmode
     \@latex@error{Command \noexpand#1invalid in math mode}%
        {%
         Please
         \ifx#2\relax
            define a new math alphabet^^J%
            if you want to use a special font in math mode%
          \else
            use the math alphabet \noexpand#2instead of
            the #1command%
         \fi
         .
        }%
   \fi}



%%%
%%% latex/1451: newline command \\ in eqnarray and output routine
%%%
\def \@shipoutsetup {%
     \@resetactivechars
     \let\-\@dischyph
     \let\'\@acci\let\`\@accii\let\=\@acciii
     \let\\\@normalcr
     %%%%%%%%%%%%%%%%
     \if@specialpage
       \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
     \fi
     \if@twoside
       \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
            \let\@themargin\oddsidemargin
       \else \let\@thehead\@evenhead
          \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
       \fi
     \fi
     \reset@font
     \normalsize
     \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
     \let\par\@@par          %% 15 Sep 87
}


%%%
%%% latex/1487: filecontents ruins \typein
%%%
\begingroup%
\gdef\filecontents{\@tempswatrue\filec@ntents}%
\catcode`\*=11 %
\gdef\filecontents*{\@tempswafalse\filec@ntents}%
\catcode`\^^M\active%
\catcode`\^^L\active\let^^L\relax%
\catcode`\^^I\active%
\gdef\filec@ntents#1{%
  \openin\@inputcheck#1 %
  \ifeof\@inputcheck%
    \@latex@warning@no@line%
        {Writing file `\@currdir#1'}%
    \chardef\verbatim@out15 %
    \ch@ck7\verbatim@out\write%
  \else%
    \closein\@inputcheck%
     %%%%%%%%%%%%%%%%%%%%
    \@latex@warning@no@line%
            {File `#1' already exists on the system.\MessageBreak%
             Not generating it from this source}%
    \def\immediate##1\relax{}%
  \fi%
  \immediate\openout\verbatim@out=#1\relax%
  \if@tempswa%
    \immediate\write\verbatim@out{%
      \@percentchar\@percentchar\space LaTeX2e file `#1'^^J%
      \@percentchar\@percentchar\space  generated by the %
         `filecontents' environment^^J%
      \@percentchar\@percentchar\space from source `\jobname' on %
         \number\year/\two@digits\month/\two@digits\day.^^J%
      \@percentchar\@percentchar}\relax%
  \fi%
  \let\do\@makeother\dospecials%
  \@vwrend%
\catcode`\^^L\active%
\let\L\@undefined%
\def^^L{\@ifundefined L^^J^^J^^J}%
\catcode`\^^I\active%
\let\I\@undefined%
\def^^I{\@ifundefined I\space\space}%
  \catcode`\^^M\active%
  \def^^M##1^^M%
    {\def\reserved@b{##1}%
     \ifx\reserved@b\reserved@a%
       \expandafter\end\expandafter{\@currenvir}%
     \else%
       \immediate\write\verbatim@out{##1}\relax\expandafter^^M%
     \fi}}%
\endgroup%


%%%
%%% 1498 (internal, orig. from Donald Arseneau) \DeclareOption not \long
%%%
\long\def\@declareoption#1#2{%
   \xdef\@declaredoptions{\@declaredoptions,#1}%
   \@namedef{ds@#1}{#2}}
\long\def\@defdefault@ds#1{\def\default@ds{#1}}


%%%
%%% 1507 (internal) \newenvironment argument parsing.
%%%
\def\new@environment#1{%
  \@ifnextchar [{\@newenva#1}{\@newenva#1[0]}}
\def\@newenva#1[#2]{%
   \@ifnextchar [{\@newenvb#1[#2]}{\@newenv{#1}{[#2]}}}
\def\@newenvb#1[#2][#3]{\@newenv{#1}{[#2][#3]}}



%%%
%%% Patch level 3
%%%

%%%
%%%  latex/1329 + 1332:  (again)
%%% The patch above managed to kill \sqrt[3] (sorry)
%%%
\def\sqrt{\@ifnextchar[\@sqrt\@@sqrt}


\typeout{%
^^J%
*********************************************^^J%
ltpatch.ltx has fixed certain problems with the `kernel' of LaTeX.^^J%
Certain other files in the LaTeX distribution have also been updated^^J%
since the December release:^^J%
base/compan.err^^J%
base/slides.dtx^^J%
base/classes.dtx^^J%
base/letter.dtx^^J%
base/latex209.dtx^^J%
base/alltt.dtx^^J%
base/latexbug.tex^^J%
base/latexbug.el^^J%
tools/multicol.dtx^^J%
tools/tabularx.dtx^^J%
tools/showkeys.dtx^^J%
^^J%
See the file patches.txt for more details.^^J%
^^J%
You may wish to update these at your site,^^J%
or wait until the next full release in June.^^J%
*********************************************}

\endinput
